package collector.core.config;

import net.apexcns.core.util.xstream.PropsConverter;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;

public class ConfigMonTask {
	@XStreamAsAttribute
	private String id;
	@XStreamAsAttribute
	@XStreamAlias("class")
	private String clazzName;
	@XStreamAsAttribute
	private int initialDelay;
	@XStreamAsAttribute
	private int period;
	@XStreamConverter(PropsConverter.class)
	private String args;
	@XStreamAsAttribute
	private String useYn;
	
	public String toString() {
		StringBuilder strb = new StringBuilder();
		strb.append("id=" + id);
		strb.append(", class=" + clazzName);
		strb.append(", initialDelay=" + initialDelay);
		strb.append(", period=" + period);
		strb.append(", args=" + args);
		return strb.toString();
	}
	
	public boolean isUseYn() {
		if(useYn==null) useYn = "Y";
		return !useYn.toUpperCase().equals("N");
	}

	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getClazzName() {
		return clazzName;
	}
	public void setClazzName(String clazzName) {
		this.clazzName = clazzName;
	}
	public int getInitialDelay() {
		return initialDelay;
	}

	public void setInitialDelay(int initialDelay) {
		this.initialDelay = initialDelay;
	}
	public int getPeriod() {
		return period;
	}
	public void setPeriod(int period) {
		this.period = period;
	}
	public String getArgs() {
		return args;
	}
	public void setArgs(String args) {
		this.args = args;
	}

	
	
	
}
